﻿

using CommunityToolkit.Mvvm.ComponentModel;

namespace Company.Shell.Models
{
    /// <summary>
    /// 表示plc的一个寄存器的值等相关信息
    /// 
    /// </summary>
    public  class PlcValue : ObservableObject
    {
        private PlcValue() { }
        public PlcValue(int id)
        {
            Id = id;
        }
        private int id;
        /// <summary>
        /// 点位编号0-99
        /// </summary>
        public int Id
        {
            get => id;
            set => SetProperty(ref id, value);
        }
        private short address = 1;
        /// <summary>
        /// 当前寄存器的地址
        /// </summary>
        public short Address
        {
            get => address;
            set => SetProperty(ref address, value);
        }
        private double _value = -1;
        /// <summary>
        /// 当前值，除了10的结果
        /// </summary>
        public double Value
        {
            get => _value;
            set => SetProperty(ref _value, value);
        }
        private ushort originValue ;
        /// <summary>
        /// 原始值，plc读取的值
        /// </summary>
        public ushort OriginValue
        {
            get => originValue;
            set => SetProperty(ref originValue, value);
        }

    }
}
